import numpy as np

class phy:
    def __init__(self):
        # protected attribute
        self._f = {}
        self._F = np.array((0., 0.))
        self._a = np.array((0., 0.))   # (0, 0) will cause trouble
        self._v = np.array((0., 0.))   # (0, 0) will cause trouble
        # for F, a and v, the first item of attribute indicates the x direction
        # while the second indicates y direction
        # -----some other natural attribute---------
        self._u = 0     # friction
        self._g = 0

    def add_f(self, fname, fvalue):
        if fname in self._f:
            self.del_f(fname)
        self._f[fname] = np.array(fvalue)
        self._F += self._f[fname]
        self.cacu_a()

    def del_f(self, fname):
        if fname in self._f:
            f = self._f.pop(fname)
            self._F -= f
        self.cacu_a()

    def cacu_a(self):
        self._a = self._F / self.m

    def cacu_v(self, t):
        self._v += self._a * t

    def set_u(self, u):
        self._u = u
    def set_g(self, g):
        self._g = g


if __name__ == '__main__':
    print 233